#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>

void rotateright(int* nums, int numsSize, int k)
{
    int arr[7];
    for (int i = 0; i < numsSize; i++)
    {
        arr[(i + k) % numsSize] = nums[i];
    }
    for (int i = 0; i < numsSize; i++)
    {
        nums[i] = arr[i];
    }
    for (int i = 0; i < 7; i++)
    {
        printf("%d ", nums[i]);
    }
    printf("\n");
}

void rotateleft(int* nums, int numsSize, int k)
{
    int arr[7];
    k = numsSize - k;
    for (int i = 0; i < numsSize; i++)
    {
        arr[(i + k) % numsSize] = nums[i];
    }
    for (int i = 0; i < numsSize; i++)
    {
        nums[i] = arr[i];
    }
    for (int i = 0; i < 7; i++)
    {
        printf("%d ", nums[i]);
    }
    printf("\n");
}

int main()
{
    int nums[7] = { 1,2,3,4,5,6,7 };
    rotateright(nums, 7, 3);
    rotateleft(nums, 7, 3);

    return 0;
}